Conversation
The class was never exported from `abel/__init__.py` and never referenced, and had accumulated enough breakage that it could not have run against a modern ImpactX: * `TaperedPL(units=0)` - the keyword is `unit`, renamed upstream long ago; the call raised `TypeError`. * `beam2particle_container(beam0, sim)` passed the simulation object positionally into the `nom_energy` slot. * The simulation was built by hand without `particle_shape` or `init_grids()`, so it raised `RuntimeError` before tracking. * The integrated focusing strength was missing its length factor: `TaperedPL(unit=0)` takes `k = L * g / (B*rho)`, but the code summed to `g * c / E`, i.e. a factor `length` too small. * The sign hard-coded electrons instead of using `beam.charge_sign()`. * A `BeamMonitor` was constructed and never used. `track()` now builds a lattice and delegates to `run_impactx()`, the same way `InterstagePlasmaLensImpactX` does, which removes the hand- rolled simulation setup entirely. `num_slices` and `use_apertures` are exposed; apertures are off by default to match the other `PlasmaLens` implementations. Verified against `PlasmaLensNonlinearThick`, which models the same drift-kick sequence: beam sizes agree to <1e-4 relative and the offset-induced deflection to <5e-4, across plain / offset / tapered configurations. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGAJYtvSuTMamdj5oaTRHz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the ImpactX
PlasmaLensusage:Probably just used in separate branches, the class was never exported and had accumulated enough breakage that it could not have run against a modern ImpactX:
TaperedPL(units=0)- the keyword isunit, renamed upstream long ago; the call raisedTypeError.beam2particle_container(beam0, sim)passed the simulation object positionally into thenom_energyslot.particle_shapeorinit_grids(), so it raisedRuntimeErrorbefore tracking.TaperedPL(unit=0)takesk = L * g / (B*rho), but the code summed tog * c / E, i.e. a factorlengthtoo small.beam.charge_sign().BeamMonitorwas constructed and never used.track()now builds a lattice and delegates torun_impactx(), the same wayInterstagePlasmaLensImpactXdoes, which removes the hand- rolled simulation setup entirely.num_slicesanduse_aperturesare exposed; apertures are off by default to match the otherPlasmaLensimplementations.Verified against
PlasmaLensNonlinearThick, which models the same drift-kick sequence: beam sizes agree to <1e-4 relative and the offset-induced deflection to <5e-4, across plain / offset / tapered configurations.